
<div class="portlet box green-haze"  ng-controller='expire_manage_controller'>
    	<div class="portlet-title">
	        <div class="caption">
	            <i class="fa fa-bar-chart"></i>annual management
	        </div>
	        <!-------------------按钮--------------------------->
			<div class='toolbox'>
				<span class='fa fa-spinner fa-spin' ng-show='uploading'></span>
				<span class="fa fa-minus toolbtn" 
					aria-hidden="true" 
					ng-show='add_new' 
					ng-click='add_new=false'>
				</span>
				<span class="fa fa-plus toolbtn" 
					aria-hidden="true" 
					ng-show='!add_new' 
					ng-click='add_new=true'>
				</span>

				<span get-excel title="export content as excel" 
					data='records' 
					heads='heads' 
					url='/attendance/getexcel/' 
					class="fa fa-sort-amount-desc toolbtn">
				</span>
			
				
			<span title='refresh accumlation annual leave' class="glyphicon glyphicon-refresh toolbtn" aria-hidden="true" ng-click='refresh_annual()'></span>
			
		
			<span class="fa fa-save toolbtn" aria-hidden="true" ng-click='update_to_server()'></span>

			</div>
        </div>
        <!------------------按钮结束---------------------------------->
 
    <div class="portlet-body">
	    
	    <!----------------------上传文件框，平常隐藏的--------------------------------->
	     <div ng-show='add_new' style='text-align: center;min-height:300px;padding-top:100px;'>
		     <!--<div file-input com='_app_records' accept='.xlsx' style='display: inline-block'></div>
			<div file-btn com='_app_records' label='导入可用假期数据' url='/attendance/upload/availeave/'></div>-->
			<div class="fl-wrap btn btn-primary" 
				ng-class='{"btn-danger":!myfile.name,"btn-success":myfile.name}'>
				<span file-loader 
					self='myfile' 
					class="hidden-input" 
					accept='.xlsx'>
				</span>
				<span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span>
			   <span ng-hide='myfile.name'>导入假期xlsx数据文件</span>
			   <span ng-bind='myfile.name'></span>
			</div>
			<div class='btn btn-primary' 
				ng-click='upload_avai(myfile)' 
				ng-disabled='!myfile.name'>
				上传
			</div>
		<span class='fa fa-spinner fa-spin' ng-show='myfile.uploading'></span>
			
			<div style='margin: 20px;border-bottom: 1px solid #18aa8c;'>
				<span>Excel格式(姓名列可以不要),注意其他head不能拼写错误</span>
				<table class="table table-bordered">
					<thead>
						<tr>				
							<th>empid</th>
							<th>姓名</th>
							<th>category</th>
							<th>date</th>
							<th>length</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>AE1856</td>
							<td>张某某</td>
							<td>annual_leave</td>
							<td>2015/1/1</td>
							<td>5.3</td>
						</tr>
							<tr>
							<td>AE1857</td>
							<td>王某某</td>
							<td>swap_off</td>
							<td>2015/1/1</td>
							<td>0.8</td>
						</tr>
					</tbody>
					
				</table>
			</div>
			
		</div>
	 <!------------------ 过滤器------------------------------->
      <div ng-include='"filter_box.html"' onload='search=search'></div>
      <!------------------表格---------------------------------->

        <table class="table table-striped table-bordered table-hover">
            <thead>
	            <tr>
		            <th ng-repeat='head in heads ' >
			            <span ng-bind='head.label'></span>
			             <span style='float: right;margin-right:20px;' 
			             	ng-show='head.editor=="text"' 
			             	class="glyphicon glyphicon-pencil" 
			             	aria-hidden="true">
			             </span>
			             <span ng-if=head.filter>
				             <span head-filter 
				             	items='org_records' 
				             	name='[[head.name]]' 
				             	self='head._filter'>
					             <span class="glyphicon glyphicon-filter" 
					             	aria-hidden="true">
					             </span>
					          </span>
			             </span>
			            <span sort-mark name='head.name' items='records'></span>
		            </th>
	            </tr>
            </thead>
            
            <tbody>
	            <tr ng-repeat='report in records | offset: currentPage*itemsPerPage | limitTo: itemsPerPage'>
		            <!--<td>
			            <input type="checkbox" name="dg" value="s" />
		            </td>-->
		            <td ng-bind='report.empid'></td>
		            <td ng-bind='report.name'></td>
		            <td ng-class='{"dirty":report.category_dirty}'>
				        <span text-select 
				         	model='report.category' 
				         	self='report.category_editor'
				         	onchanged='report.category_dirty=true;report.dirty=true'
				         	options='["annual_leave","swap_off"]' 
				         	class='editable'>
				        </span>
		            </td>
		         
		            <td ng-class='{"dirty":report.start_date_dirty}'>
				         <span text-input 
				         	model='report.start_date' 
				         	self='report.start_date_editor'
				         	onchanged='report.start_date_dirty=true;report.dirty=true' 
				         	width='80px' 
				         	pattern='^[0-9]{4}-[0-9]{2}-[0-9]{2}$' 
				         	class='editable'>
				         </span>
		            </td>
		            <td ng-class='{"dirty":report.span_dirty}'>
			            <span text-input 
			            	class='editable' 
			            	model='report.span.value' 
			            	self='report.span_dirty_eidtor'
			            	onchanged='report.span_dirty=true;report.dirty=true'
			            	width='50px' 
			            	pattern='^[0-9]+(\.[0-9]{1,2})?$'>
			            </span>
			            <span ng-bind='report.span.unit'></span>
			         </td>
					<td >
						<span ng-bind='report.used.value'></span>
						<span ng-bind='report.used.unit'></span>
					</td>
		            <!--<td ng-class='{"dirty":report.used_dirty}' class='editable' ng-click='report.used_edit=true'>
			         <span edit-text  model='report.used' makedirty='makedirty(report,"used_dirty")' width='50px' pattern='^[0-9]{2}:[0-9]{2}$' show-editor='report.used_edit'></span>
		            </td>-->
		            
		            <td ng-class='{"dirty":report.is_valid_dirty}'>
			         <span text-select 
			         	class='editable' 
			         	model='report.is_valid' 
			         	options='[true,false]' 
			         	onchanged='report.is_valid_dirty=true;report.dirty=true'>
			         </span>
		            </td>
		            
		            <td ng-class='{"dirty":report.note_dirty}' 
		            	class='editable' 
		            	ng-click='report.note_editor.show()'>
			            <span text-input 
			            	model='report.note' 
			            	self='report.note_editor'
			            	onchanged='report.note_dirty=true;report.dirty=true'>
			            </span>
		            </td>
	            </tr>

            </tbody>
        </table>
		<div page-foot per='itemsPerPage' crt='currentPage' items='records' style='text-align: right;'></div>
    </div>
 </div>